/*    */ package com.zimbra.cs.redolog.op;
/*    */ 
/*    */ import com.zimbra.cs.mailbox.Mailbox;
/*    */ import com.zimbra.cs.mailbox.MailboxManager;
/*    */ import com.zimbra.cs.mailbox.MailboxOperation;
/*    */ import com.zimbra.cs.redolog.RedoLogInput;
/*    */ import com.zimbra.cs.redolog.RedoLogOutput;
/*    */ import java.io.IOException;
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ public class SetSubscriptionData
/*    */   extends RedoableOp
/*    */ {
/*    */   private int mFolderId;
/*    */   private long mLastItemDate;
/*    */   private String mLastItemGuid;
/*    */   
/*    */   public SetSubscriptionData()
/*    */   {
/* 37 */     super(MailboxOperation.SetSubscriptionData);
/* 38 */     this.mFolderId = -1;
/* 39 */     this.mLastItemGuid = "";
/*    */   }
/*    */   
/*    */   public SetSubscriptionData(int mailboxId, int folderId, long date, String guid) {
/* 43 */     this();
/* 44 */     setMailboxId(mailboxId);
/* 45 */     this.mFolderId = folderId;
/* 46 */     this.mLastItemDate = date;
/* 47 */     this.mLastItemGuid = (guid == null ? "" : guid);
/*    */   }
/*    */   
/*    */   protected String getPrintableData() {
/* 51 */     StringBuffer sb = new StringBuffer("id=").append(this.mFolderId);
/* 52 */     sb.append(", date=").append(this.mLastItemDate);
/* 53 */     sb.append(", guid=").append(this.mLastItemGuid);
/* 54 */     return sb.toString();
/*    */   }
/*    */   
/*    */   protected void serializeData(RedoLogOutput out) throws IOException {
/* 58 */     out.writeInt(this.mFolderId);
/* 59 */     out.writeLong(this.mLastItemDate);
/* 60 */     out.writeUTF(this.mLastItemGuid);
/*    */   }
/*    */   
/*    */   protected void deserializeData(RedoLogInput in) throws IOException {
/* 64 */     this.mFolderId = in.readInt();
/* 65 */     this.mLastItemDate = in.readLong();
/* 66 */     this.mLastItemGuid = in.readUTF();
/*    */   }
/*    */   
/*    */   public void redo() throws Exception {
/* 70 */     Mailbox mbox = MailboxManager.getInstance().getMailboxById(getMailboxId());
/* 71 */     mbox.setSubscriptionData(getOperationContext(), this.mFolderId, this.mLastItemDate, this.mLastItemGuid);
/*    */   }
/*    */ }


/* Location:              /home/mint/zimbrastore.jar!/com/zimbra/cs/redolog/op/SetSubscriptionData.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       0.7.1
 */